<?php
/**
 * 公共参数
 */
namespace App\Http\Controllers;
use App\Models\AuthRule;
use App\Models\SysConfig;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;

class PublicController extends Controller {

    public static $gx_init = [
        1 => '启用',
        2 => '禁用',
    ];

    public static function getHost() {
        return SysConfig::where("varname","web_name")->value("value");
    }

    /**
     * 状态显示
     * @param $status
     * @return string
     */
    public static function  status_badge($status)
    {
        $dw_init = self::$gx_init;
        $text    = $dw_init[$status];
        if ($status == 1) {
            echo "<span class=\"layui-badge layui-bg-green\">{$text}</span>";
        } else {
            echo "<span class=\"layui-badge\">{$text}</span>";
        }
    }




}
